vcTransportNode

Defines a logical place where product instances can be transported to and from. Each transport node has to be assigned a component container, but can also be connected to a motion path as a sensor. When connected as a sensor, the node will grab arriving products from the path to its component container and can similarly place leaving components to the connected path.

See in: Overview

Module: vcProcessModel

Parent: vcBehavior

Children -

Referenced by: vcBufferProductsStatement.DestinationTransportNode, vcProcessExecutor.TransportNode, vcProduct.LastEnteredNode, vcProductFeed.SourceNode, ... (see more)
vcBufferProductsStatement.DestinationTransportNode
vcProcessExecutor.TransportNode
vcProduct.LastEnteredNode
vcProductFeed.SourceNode
vcProductNeed.TargetNode
vcTransportLink.Destination
vcTransportLink.Source
vcTransportOutStatementBase.DestinationNode
vcTransportSolution.Destination
vcTransportSolution.Source
vcTransportSystem.Nodes

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ComponentContainervcContainerRWGets or sets the component container this node monitors for arriving products. Using other behavior than component container may cause issues.
DefaultProductPositionFramevcFrameFeatureRWGets or sets the default position for products.
DefaultResourcePositionFramevcFrameFeatureRWGets or sets the default position for resources.
ProcessExecutorvcProcessExecutorRGets the associated process executor.
See more
This property is read only; it's value can be changed by setting the transport node property on a process executor.
SensorFramevcFrameFeatureRWGets or sets the frame feature referenced as the sensor's physical location. Only used when connected to a path as sensor.
SensorResetAtvcTriggerPositionRWGets or sets the mode for resetting the sensor. See path constants for more information. Only used when connected to a path as sensor.
SensorTriggerAtvcTriggerPositionRWGets or sets the mode for triggering the sensor. See path constants for more information. Only used when connected to a path as sensor.
TransportSystemvcTransportSystemRGets the associated transport system.
VisualPositionvcMatrixRGets the visualization position of this node in world coordinates.
VisualPositionFramevcFrameFeatureRWGets or sets the component container this node monitors for arriving products. Using other behavior than component container may cause issues.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
beginTransportOutNonevcProduct productBegin the process of transporting the given product through its transport solution.
See more
Note that transport is asynchronous i.e. the product won't leave immediately.

Parameters:
product (vcProduct): The product instance to begin transporting.
createTransportTargetvcTransportTargetvcProduct productCreates a new transport target object for this node and assigns it for the given product instance.
See more
The target is created with the default values of this transport node.
Replaces any existing transport target assigned to the given product in this node.
Note that the node automatically deletes any transport targets when they are no longer needed.

Parameters:
product (vcProduct): The product to assign the transport target to.

Returns:
vcTransportTarget: The created transport target.
deleteTransportTargetNonevcProduct productGets the transport target in this node assigned for a given product instance.
See more
Note that the node automatically deletes any transport targets when they are no longer needed.

Parameters:
product (vcProduct): The product to get the transport target of.

Returns:
vcTransportTarget: The transport target of the given product. Returns None if a target is not defined.
getTransportTargetvcTransportTargetvcProduct productGets the transport target in this node assigned for a given product instance.
See more
Note that the node automatically deletes any transport targets when they are no longer needed.

Parameters:
product (vcProduct): The product to get the transport target of.

Returns:
vcTransportTarget: The transport target of the given product. Returns None if a target is not defined.
setOnProductArrivingNoneCallable OR None functionSets the callback that is called when a product instance arrives to this node.
See more
The callback should return True if the node accepted this product and handled it.
If the callback does not return True, the product will be handled by internal logic, which includes allowing process statements to receive it.

Parameters:
function (callable): The function to call when the event is triggered.

Callback arguments:
product (vcProduct): Product instance that arrived to this node.
link (vcTransportLink): Link that the product arrived to this node from.
setOnProductLeavingNoneCallable OR None functionSets the callback that is called when a product leaves this transport node.
See more
Link is the link that the product left towards and can be None if the product doesn't have a transport solution or the solution doesn't have a transport link going out from this transport node.

Parameters:
function (callable): The function to call when the event is triggered.

Callback arguments:
product (vcProduct): Product instance that left this node.
link (vcTransportLink): Link that the product left towards.
setOnTransportTargetRequestedNoneCallable OR None functionSets the callback that is called when a transport target is requested for the product.
See more
In practice, this happens each time that a transport controller or resource is transporting a product instance and needs a for the product instance.

Parameters:
function (callable): The function to call when the event is triggered.

Callback arguments:
product (vcProduct): Product instance that requested the transport target.
target (vcTransportTarget): Requested transport target.

Example: Assign New Target Location for the Requested Product

''' vcTransportNode: Assign new target location for the requested product '''

import vcCore as vc

comp = vc.getComponent()
transport_node = comp.findBehavior("TransportNode")

def when_transport_target_requested(product, transport_target):  
  product_matrix = transport_target.ProductPosition
  print(f"Original target: {product_matrix}")
  product_matrix.translateRel(0.0, 0.0, 1000.0)
  print(f"Modified target: {product_matrix}")
  transport_target.ProductPosition = product_matrix
 
transport_node.setOnTransportTargetRequested(when_transport_target_requested)

Example: Change Machine Material to Red When It Gets Product

''' vcTransportNode: Change machine's material to red when it gets a product ''' 

import vcCore as vc

app = vc.getApplication()
red_matte = app.findMaterial('red_matte')
white_matte = app.findMaterial('white_matte')

comp = vc.getComponent()
transport_node = comp.findBehavior("TransportNode")

def when_product_arriving(product, link):
  comp.Material = red_matte
 
transport_node.setOnProductArriving(when_product_arriving)

def when_product_leaving(product, link):
  comp.Material = white_matte
 
transport_node.setOnProductLeaving(when_product_leaving)

Example: Event Handler When a Product Arrives to or Leaving From Node

''' vcTransportNode: Event handler when a product arrives to or leaving from node '''

import vcCore as vc

comp = vc.getComponent()
transport_node = comp.findBehavior("TransportNode")

def when_product_arriving(product, link):
  print(f"Arriving: {product}, {link}")
 
transport_node.setOnProductArriving(when_product_arriving)

def when_product_leaving(product, link):
  print(f"Leaving: {product}, {link}")
 
transport_node.setOnProductLeaving(when_product_leaving)